home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 322 / flex / flexskcm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  2.7 KB  |  96 lines

  1. /*  used to be flexskelcom.h -- jrd */
  2. /* common macro definitions for C/FTL programs generated by flex */
  3.  
  4.  
  5. /* returned upon end-of-file */
  6. #define YY_END_TOK 0
  7.  
  8. /* action number for an "end-of-file was seen and yywrap indicated that we
  9.  * should continue processing"
  10.  */
  11. #define YY_NEW_FILE -1
  12.  
  13. /* action number for "the default action should be done" */
  14. #define YY_DO_DEFAULT -2
  15.  
  16. #ifndef BUFSIZ
  17. #include <stdio.h>
  18. #endif
  19.  
  20. #define YY_BUF_SIZE (BUFSIZ * 2) /* size of input buffer */
  21.  
  22. /* number of characters one rule can match.  One less than YY_BUF_SIZE to make
  23.  * sure we never access beyond the end of an array
  24.  */
  25. #define YY_BUF_MAX (YY_BUF_SIZE - 1)
  26.  
  27. /* we will never use more than the first YY_BUF_LIM + YY_MAX_LINE positions
  28.  * of the input buffer
  29.  */
  30. #ifndef YY_MAX_LINE
  31. #define YY_MAX_LINE BUFSIZ
  32. #endif
  33.  
  34. #define YY_BUF_LIM (YY_BUF_MAX - YY_MAX_LINE)
  35.  
  36. /* copy whatever the last rule matched to the standard output */
  37.  
  38. #define ECHO fputs( yytext, yyout )
  39.  
  40. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  41.  * is returned in "result".
  42.  */
  43. #ifdef atarist
  44. #define YY_INPUT(buf,result,max_size) \
  45.     if ( (result = cr_filtering_read(yyin, buf, max_size )) < 0 ) \
  46.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  47. #else
  48. #define YY_INPUT(buf,result,max_size) \
  49.     if ( (result = read( fileno(yyin), buf, max_size )) < 0 ) \
  50.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  51. #endif
  52. #define YY_NULL 0
  53.  
  54. /* macro used to output a character */
  55. #define YY_OUTPUT(c) putc( c, yyout );
  56.  
  57. /* report a fatal error */
  58. #define YY_FATAL_ERROR(msg) \
  59.     { \
  60.     fputs( msg, stderr ); \
  61.     putc( '\n', stderr ); \
  62.     exit( 1 ); \
  63.     }
  64.  
  65. /* returns the first character of the matched text */
  66. #define YY_FIRST_CHAR yy_ch_buf[yy_b_buf_p]
  67.  
  68. /* default yywrap function - always treat EOF as an EOF */
  69. #define yywrap() 1
  70.  
  71. /* enter a start condition.  This macro really ought to take a parameter,
  72.  * but we do it the disgusting crufty way that old Unix-lex does it
  73.  */
  74. #define BEGIN yy_start = 1 +
  75.  
  76. /* callable from YY_INPUT to set things up so that '%' will match.  Proper
  77.  * usage is "YY_SET_BOL(array,pos)"
  78.  */
  79. #define YY_SET_BOL(array,pos) array[pos - 1] = '\n';
  80.  
  81. /* default declaration of generated scanner - a define so the user can
  82.  * easily add parameters
  83.  */
  84. #define YY_DECL int yylex()
  85.  
  86. /* return all but the first 'n' matched characters back to the input stream */
  87. #define yyless(n) \
  88.     { \
  89.     YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ \
  90.     yy_c_buf_p = yy_b_buf_p + n - 1; \
  91.     YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  92.     }
  93.  
  94. /* code executed at the end of each rule */
  95. #define YY_BREAK break;
  96.